import request from '@/utils/request'

const api_path = '/admin/user/wxpMenu'

export default {

  findMenuInfo() {
    return request({
      url: `${api_path}/findMenuInfo`,
      method: `get`
    })
  },

  findOneMenuInfo() {
    return request({
      url: `${api_path}/findOneMenuInfo`,
      method: `get`
    })
  },

  save(menu) {
    return request({
      url: `${api_path}/add`,
      method: `post`,
      data: menu
    })
  },

  getById(id) {
    return request({
      url: `${api_path}/info/${id}`,
      method: `get`
    })
  },

  updateById(menu) {
    return request({
      url: `${api_path}/update`,
      method: `put`,
      data: menu
    })
  },

  syncMenu() {
    return request({
      url: `${api_path}/syncMenu`,
      method: `get`
    })
  },

  removeById(id) {
    return request({
      url: `${api_path}/delete`,
      method: 'delete',
      data: [id]
    })
  },

  removeMenu() {
    return request({
      url: `${api_path}/removeMenu`,
      method: `delete`
    })
  }
}
